// Copyright 2025 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef PRIVACY_PROOFS_ZK_LIB_CIRCUITS_ANONCRED_SMALL_EXAMPLES_H_
#define PRIVACY_PROOFS_ZK_LIB_CIRCUITS_ANONCRED_SMALL_EXAMPLES_H_

#include <cstddef>
#include <cstdint>

#include "algebra/static_string.h"

namespace proofs {

struct SmallTest {
  StaticString pkx, pky; /* public key of the issuer */
  StaticString sigr, sigs, sigtr, sigts;
  uint8_t transcript[1024];
  size_t transcript_size;
  uint8_t *now;
  size_t mdoc_size;
  uint8_t mdoc[5000];
};

static const struct SmallTest mdoc_small_tests[] = {
    // Example that requires 3 SHA blocks for the credential.
    {StaticString(
         "0x298aa30b14298b8bdb5b2b1cc0150e84a86a1469fa813f8df0f0bd09d8489661"),
     StaticString(
         "0x2f821d00395d0c63b222a8613c7af5f5cb2b655dda6c3926af7ea3acd6a05fba"),
     StaticString(
         "0xc96b7605f15536877592c24d4d65066a377c34e3e6a624ea52ce9d899207"),
     StaticString(
         "0xaca1128a3460368caefc5c24a27a7f9e8cc8d590b93485db2c408d1ac96d80ae"),
     StaticString(
         "0x08ca78156b6c60c711e501641d4b5000f1ff7715386f1186ce4aec1d6eb2ba92"),
     StaticString(
         "0xfdcb8d4da84f1dc03a7bd22909a6bcc103281310f9fe1fb97c13e5d2eb6934df"),
     {0x60, 0x80, 0xf3, 0x09, 0x55, 0x56, 0xe5, 0x21, 0x4c, 0x5f, 0xff,
      0x7c, 0x6d, 0x3d, 0xcb, 0x90, 0x3e, 0x2d, 0xcc, 0x45, 0x42, 0x9c,
      0x4d, 0x81, 0xf9, 0x80, 0x8d, 0x5e, 0x7a, 0xd2, 0x14, 0x50},
     32,
     (uint8_t *)"20241005",
     183,
     {0x45, 0x72, 0x69, 0x6b, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x75, 0x73, 0x74,
      0x65, 0x72, 0x6d, 0x61, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
      0x00, 0x00, 0x00, 0x00, 0x31, 0x39, 0x38, 0x30, 0x30, 0x31, 0x30, 0x31,
      0x00, 0xf5, 0xf5, 0xf5, 0xf5, 0xf4, 0xf4, 0xf4, 0x00, 0x00, 0x00, 0x00,
      0x32, 0x30, 0x32, 0x34, 0x31, 0x30, 0x30, 0x31, 0x32, 0x30, 0x32, 0x35,
      0x31, 0x30, 0x30, 0x31, 0x3c, 0xeb, 0x4a, 0xec, 0x0d, 0x76, 0xbb, 0x50,
      0x35, 0x09, 0xc6, 0x46, 0xad, 0xc6, 0x30, 0x3f, 0xb9, 0xea, 0xa5, 0x84,
      0xb4, 0x8f, 0xa0, 0xbe, 0x07, 0x6f, 0x14, 0x28, 0xe4, 0xec, 0x3b, 0x37,
      0x77, 0x91, 0x61, 0xbe, 0xb9, 0x86, 0x90, 0xfb, 0xc8, 0xe3, 0x57, 0x5a,
      0x9d, 0xd9, 0x41, 0x91, 0xae, 0x8e, 0x4d, 0xbe, 0x2c, 0x44, 0x39, 0x07,
      0x69, 0xea, 0x0c, 0x08, 0x80, 0x22, 0xf2, 0xc6, 0x00, 0x00, 0x00, 0x00,
      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
      0x00, 0x00, 0x00}},
    // The next examples requires 4 SHA blocks for the credential.
    {
        StaticString("0x08a25115e57d680260aafa44e674d45d43af885fffa6746b44ece71"
                     "cd42febd2"),
        StaticString("0x4a177f6c38543876c66573218db63de627d343f16a483a313069830"
                     "37df79b2f"),
        StaticString("0x95394343021474ed688e7e783063c768a3343def0f1245f1da09406"
                     "34eb57410"),
        StaticString("0x4953b2f11cd46c8e1673ac50ddc51665702a27e5788eca3a8bffa67"
                     "fbdbf65ce"),
        StaticString("0x1ca6eef3238ec5320429774f6b6b743cc868b3cfebff96c41112b36"
                     "5638a9dc5"),
        StaticString("0x7e303bd730d0e663621ddcaf52991ba9f744cabe161598a44b4508f"
                     "de7bdaf2d"),

        {0x60, 0x80, 0xf3, 0x09, 0x55, 0x56, 0xe5, 0x21, 0x4c, 0x5f, 0xff,
         0x7c, 0x6d, 0x3d, 0xcb, 0x90, 0x3e, 0x2d, 0xcc, 0x45, 0x42, 0x9c,
         0x4d, 0x81, 0xf9, 0x80, 0x8d, 0x5e, 0x7a, 0xd2, 0x14, 0x50},
        32,
        (uint8_t *)"20241005",
        247,
        {0x45, 0x72, 0x69, 0x6b, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x75, 0x73, 0x74,
         0x65, 0x72, 0x6d, 0x61, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
         0x00, 0x00, 0x00, 0x00, 0x31, 0x39, 0x38, 0x30, 0x30, 0x31, 0x30, 0x31,
         0x00, 0xf5, 0xf5, 0xf5, 0xf5, 0xf4, 0xf4, 0xf4, 0x00, 0x00, 0x00, 0x00,
         0x32, 0x30, 0x32, 0x34, 0x31, 0x30, 0x30, 0x31, 0x32, 0x30, 0x32, 0x35,
         0x31, 0x30, 0x30, 0x31, 0x3e, 0xf6, 0x39, 0x05, 0x33, 0xf8, 0xf3, 0x37,
         0x7d, 0xe0, 0xb2, 0xb5, 0x65, 0x19, 0x93, 0x3f, 0x49, 0xe1, 0xa1, 0x41,
         0x57, 0xa5, 0x22, 0x0e, 0xac, 0x79, 0x8a, 0xe2, 0xe2, 0xea, 0xd2, 0x0c,
         0x9f, 0x23, 0x3d, 0x1b, 0xe2, 0x8e, 0x69, 0xc1, 0xda, 0x76, 0xec, 0xf9,
         0xc3, 0x0c, 0xf9, 0x3b, 0xb5, 0xb6, 0x69, 0x6f, 0xc6, 0xc2, 0x8a, 0xa8,
         0x98, 0x19, 0x7d, 0xbf, 0xea, 0x6d, 0xad, 0x40, 0x00, 0x00, 0x00, 0x00,
         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    },
};

}  // namespace proofs

#endif  // PRIVACY_PROOFS_ZK_LIB_CIRCUITS_ANONCRED_SMALL_EXAMPLES_H_
